#include <windows.h>

static	HHOOK	gHook = NULL;
HINSTANCE	hModule;

BOOL	APIENTRY	DllMain(_In_ HANDLE _HDllHandle, _In_ DWORD _Reason, _In_opt_ LPVOID _Reserved)
{
	hModule = (HINSTANCE)_HDllHandle;
	return TRUE;
}

LRESULT	CALLBACK	HookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
	return	CallNextHookEx(gHook, nCode, wParam, lParam);
}
BOOL	InstallHook()
{
	gHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)HookProc, hModule, 0);
	return TRUE;
}